package dao

import (
	"gitee.com/Luna-CY/Golang-Project-Template/internal/context"
	"gitee.com/Luna-CY/Golang-Project-Template/internal/errors"
    "gitee.com/Luna-CY/Golang-Project-Template/model"
)

// SystemObject Data access object for SystemObject definition
type SystemObject interface {
	Transactional
	
	// FindSystemObjectByCondition find SystemObject by simple condition from db
	FindSystemObjectByCondition(ctx context.Context, page int, size int, options ...SystemObjectOption) (int64, []*model.SystemObject, errors.Error)
	
	// SaveSystemObject save SystemObject to db
	// if SystemObject id is 0, it will create a new record, otherwise, it will update the record
	SaveSystemObject(ctx context.Context, systemObject *model.SystemObject) errors.Error

	// TakeSystemObjectByCondition get SystemObject by condition from db
	// if SystemObject not found, return error type with errors.ErrorTypeRecordNotFound
	TakeSystemObjectByCondition(ctx context.Context, options ...SystemObjectOption) (*model.SystemObject, errors.Error)

	// DeleteSystemObjectByCondition delete SystemObject by condition from db
	DeleteSystemObjectByCondition(ctx context.Context, options ...SystemObjectOption) errors.Error

	// BatchTakeSystemObjectByCondition get SystemObject by condition from db
	BatchTakeSystemObjectByCondition(ctx context.Context, options ...SystemObjectOption) ([]*model.SystemObject, errors.Error)
}

